<?
//引入所有子系统信息
include_once("../../../common/model/extender_import.php");

//查看最近100个未发送的优惠券



$_coupon_send_not_yet_list=select_lines_all_items($table_Prefix."coupon_send_list","nid asc","send_date is null ","100");
$_coupon_send_yet_list    =select_lines_all_items($table_Prefix."coupon_send_list","nid asc","send_date is not null","100");


if(($_coupon_send_not_yet_list) && ($_coupon_send_yet_list))
{
  $_coupon_send_list=array_merge($_coupon_send_not_yet_list,$_coupon_send_yet_list);
}
if(!$_coupon_send_not_yet_list)
{
    $_coupon_send_list=$_coupon_send_yet_list;
}
if(!$_coupon_send_yet_list)
{
    $_coupon_send_list=$_coupon_send_not_yet_list;
}



$p["source"]     = $_coupon_send_list;
$p["sourceitem"] = "member_nid";
$p["table"]      =$table_prefix."member";
$p["sortorder"]  = "nid desc";
$p["targetitem"] = "nid";
$_member=select_lines_by_2darray($p);
$member=transform_2darray_in_1darray_with_new_key($_member,"nid","nickname");

$p2["source"]     = $_coupon_send_list;
$p2["sourceitem"] = "coupon_nid";
$p2["table"]      =$table_prefix."coupon";
$p2["sortorder"]  = "nid desc";
$p2["targetitem"] = "nid";
$_coupon=select_lines_by_2darray($p2);
$coupon=transform_2darray_in_1darray_with_new_key($_coupon,"nid","name");

?>








